<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	 <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
     <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
     <script src="http://zeptojs.com/zepto.min.js"></script>
	<title>testWx1111</title>
	<style>
		.img {
			width: 200px;
			height: 200px;
		}
		.img img {
			width: 100%;
			height: 100%;
		}
	</style>
</head>
<body>
	<div class="asd">

        <ol>
            <li><p>我就是想测试一下看看这个破微信分享到底是个什么鬼！</p></li>
            <li><p>本地域名环境配置@吕志良</p> </li>
            <li> <p>注意使用最新版微信js-sdk（需引入jweixin.js）</p></li>
            <li><p>需要后台接口支持</p></li>
            <li><p>完成依据数据的自定义微信分享标题、内容、链接、图片等信息</p></li>
        </ol>
		   
	</div>
	<div class="img"><img src="img/1.jpg"></div>
	<script>
		
        var shareObj={
            imgUrl:'http://img.tgljweb.com/note_2740525_1501145032.9521.jpeg',
            // link: window.location.href,//不传默认当前页面@zc20170930test
            desc: "测试分享描述信息@zc20170930",
            title: '标题分享测试@zc20170930',
        };

        $(function() {
            !function getWxInitial() {
                $.ajax({
                    type:'POST',
                    url:'http://javaapi.tgljweb.com:9090/api/unionpay/getwxinitconfig',
                    data:JSON.stringify({url: window.location.href.split("#")[0]}),
                    contentType:'application/json;charset=UTF-8',
                    success:function(res) {
                        var data=res.data;
                        wx.config({
                            debug: false,
                            appId: data.appid,
                            timestamp:data.timestamp,
                            nonceStr: data.noncestr, 
                            signature: data.signature,
                            jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','MenuShareWeibo','onMenuShareQZone']
                        });
                        shareObj.title='test.htmltet';
                    },
                    error:function(xhr) {
                        console.log(xhr);
                    }

                })
                // wx.ready(function() {
                //     alert(123);
                // })
            }();

            wx.ready(function() {
                // wx.onMenuShareAppMessage(obj);
                wx.onMenuShareAppMessage(shareObj);
                wx.onMenuShareTimeline(shareObj);
            })
           
        })
	</script>
</body>
</html>